package com.v1.video.view;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;

import com.iss.app.AbsDialog;
import com.v1.video.R;

public class Dialog3GUpload extends AbsDialog implements View.OnClickListener{
    private Context mContext;
    public Dialog3GUpload(Context context) {
        super(context,R.style.dialog_menu);
        mContext = context;
        View view = LayoutInflater.from(mContext).inflate(R.layout.dialog_3g_upload, null);
        setContentView(view);
        setProperty(1, 1);
    }

    @Override
    protected void initView() {
    }

    @Override
    protected void initData() {
    }

	@Override
	protected void setListener() {
		findViewById(R.id.layout_root).setOnClickListener(this);
		findViewById(R.id.textView_cancel).setOnClickListener(this);
		findViewById(R.id.textView_ok).setOnClickListener(this);
    }

    @Override
    public void onClick(View v) {
        switch(v.getId()){
            case R.id.layout_root:
                dismiss();
                break;
            case R.id.textView_cancel:
            	dismiss();
            	
            	break;
            case R.id.textView_ok:
            	dismiss();
            	if(mAction!=null){
                    mAction.onConfirm();
                }
            	break;
        }
        
    }
    
    public void show(OnConfirmAction action) {
    	super.show();
    	mAction = action;
    }
    
    public interface OnConfirmAction{
    	public void onConfirm();
    }
    
    private OnConfirmAction mAction;
    
    public void setOnConfirmAction(OnConfirmAction action){
    	mAction = action;
    }
    

}
